#include "map.h"
#include"config.h"

map::map()
{
    m_map1.load(":/picture/images/background-1.png");
    m_map2.load(":/picture/images/background-1.png");
    m_map1_posY=-GAME_HEIGHT;
    m_map2_posY=0;
    m_scroll_speed=MAP_SCROLL_SPEED;
}

void map::mapPosition()
{
    m_map1_posY += m_scroll_speed;
    if(m_map1_posY>=0)
    {
         m_map1_posY=-GAME_HEIGHT;
    }
    m_map2_posY += m_scroll_speed;
    if(m_map2_posY>=GAME_HEIGHT)
    {
         m_map2_posY=0;
    }
}
